home *** CD-ROM | disk | FTP | other *** search
/ This Disc Bytes! / Power Computing - The Disc 2 - This Disc Bytes.ISO / mac / CodeWarrior 7 Lite for 68K / MacOS Support / Headers / Universal Headers / ScalerTypes.h < prev    next >
Text File  |  1995-07-06  |  25KB  |  574 lines

  1. /*
  2.      File:        ScalerTypes.h
  3.  
  4.      Contains:    Apple public font scaler object and constant definitions
  5.  
  6.      Version:    Technology:    Quickdraw GX 1.1
  7.                  Package:    Universal Interfaces 2.1 in “MPW Latest” on ETO #18
  8.  
  9.      Copyright:    © 1984-1995 by Apple Computer, Inc.
  10.                  All rights reserved.
  11.  
  12.      Bugs?:        If you find a problem with this file, use the Apple Bug Reporter
  13.                  stack.  Include the file and version information (from above)
  14.                  in the problem description and send to:
  15.                      Internet:    apple.bugs@applelink.apple.com
  16.                      AppleLink:    APPLE.BUGS
  17.  
  18. */
  19.  
  20. #ifndef __SCALERTYPES__
  21. #define __SCALERTYPES__
  22.  
  23.  
  24. #ifndef __TYPES__
  25. #include <Types.h>
  26. #endif
  27. /*    #include <ConditionalMacros.h>                                */
  28.  
  29. #ifndef __MIXEDMODE__
  30. #include <MixedMode.h>
  31. #endif
  32.  
  33. #ifndef __GXMATH__
  34. #include <GXMath.h>
  35. #endif
  36. /*    #include <FixMath.h>                                        */
  37.  
  38. #ifndef __SFNTTYPES__
  39. #include <SFNTTypes.h>
  40. #endif
  41. /*    #include <GXTypes.h>                                        */
  42.  
  43. #ifdef __cplusplus
  44. extern "C" {
  45. #endif
  46.  
  47. #if PRAGMA_ALIGN_SUPPORTED
  48. #pragma options align=mac68k
  49. #endif
  50.  
  51. #if PRAGMA_IMPORT_SUPPORTED
  52. #pragma import on
  53. #endif
  54.  
  55. #define scalerTypeIncludes
  56. /* old header = scaler types */
  57.  
  58.  
  59. enum {
  60.     truetypeFontFormatTag        = 'true',
  61.     type1FontFormatTag            = 'typ1',
  62.     nfntFontFormatTag            = 'nfnt'
  63. };
  64.  
  65. enum {
  66.     scaler_first_error            = 1,
  67.     scaler_first_warning        = 1024
  68. };
  69.  
  70. enum {
  71.     kOFAVersion1Dot0            = 0x10000,
  72.     kOFAVersion1Dot1            = 0x10100                        /* added scalerVariationInfo */
  73. };
  74.  
  75. enum scalerErrors {
  76.     scaler_no_problem            = 0,                            /* Everything went OK */
  77.     scaler_null_context            = scaler_first_error,            /* Client passed a null context pointer */
  78.     scaler_null_input            = scaler_first_error + 1,        /* Client passed a null input pointer */
  79.     scaler_invalid_context        = scaler_first_error + 2,        /* There was a problem with the context */
  80.     scaler_invalid_input        = scaler_first_error + 3,        /* There was a problem with an input */
  81.     scaler_invalid_font_data    = scaler_first_error + 4,        /* A portion of the font was corrupt */
  82.     scaler_new_block_failed        = scaler_first_error + 5,        /* A call to NewBlock() failed */
  83.     scaler_get_font_table_failed = scaler_first_error + 6,        /* The table was present (length > 0) but couldn't be read */
  84.     scaler_bitmap_alloc_failed    = scaler_first_error + 7,        /* Call to allocate bitmap permanent block failed */
  85.     scaler_outline_alloc_failed    = scaler_first_error + 8,        /* Call to allocate outline permanent block failed */
  86.     scaler_required_table_missing = scaler_first_error + 9,        /* A needed font table was not found */
  87.     scaler_unsupported_outline_format = scaler_first_error + 10, /* Couldn't create an outline of the desired format */
  88.     scaler_unsupported_stream_format = scaler_first_error + 11,    /* ScalerStreamFont() call can't supply any requested format */
  89.     scaler_unsupported_font_format = scaler_first_error + 12,    /* No scaler supports the font format */
  90.     scaler_hinting_error        = scaler_first_error + 13,        /* An error occurred during hinting */
  91.     scaler_scan_error            = scaler_first_error + 14,        /* An error occurred in scan conversion */
  92.     scaler_internal_error        = scaler_first_error + 15,        /* Scaler has a bug */
  93.     scaler_invalid_matrix        = scaler_first_error + 16,        /* The transform matrix was unusable */
  94.     scaler_fixed_overflow        = scaler_first_error + 17,        /* An overflow ocurred during matrix operations */
  95.     scaler_API_version_mismatch    = scaler_first_error + 18,        /* Scaler requires a newer/older version of the scaler API */
  96.     scaler_streaming_aborted    = scaler_first_error + 19,        /* StreamFunction callback indicated that streaming should cease */
  97.     scaler_last_error            = scaler_streaming_aborted,
  98.     scaler_no_output            = scaler_first_warning,            /* Couldn't fulfill any glyph request. */
  99.     scaler_fake_metrics            = scaler_first_warning,            /* Returned metrics aren't based on information in the font */
  100.     scaler_fake_linespacing        = scaler_first_warning,            /* Linespacing metrics not based on information in the font */
  101.     scaler_glyph_substitution    = scaler_first_warning,            /* Requested glyph out of range, a substitute was used */
  102.     scaler_last_warning            = scaler_glyph_substitution
  103. };
  104.  
  105. typedef long scalerError;
  106.  
  107. /* ScalerOpen output type */
  108. struct scalerInfo {
  109.     gxFontFormatTag                    format;                        /* Font format supported by this scaler */
  110.     Fixed                            scalerVersion;                /* Version number of the scaler */
  111.     Fixed                            APIVersion;                    /* Version of API implemented (compare with version in scalerContext) */
  112. };
  113. typedef struct scalerInfo scalerInfo;
  114.  
  115. /* ScalerNewFont output type */
  116.  
  117. enum scalerFontFlags {
  118.     requiresLayoutFont            = 1,
  119.     hasNormalLayoutFont            = 2,
  120.     canReorderFont                = 4,
  121.     canRearrangeFont            = 8,
  122.     hasOutlinesFont                = 16
  123. };
  124.  
  125. typedef long scalerFontFlag;
  126.  
  127. struct scalerFontInfo {
  128.     unsigned long                    unitsPerEm;
  129.     scalerFontFlag                    flags;
  130.     unsigned long                    numGlyphs;
  131. };
  132. typedef struct scalerFontInfo scalerFontInfo;
  133.  
  134. /* ScalerNewTransform input types */
  135. /* ScalerNewVariation1Dot1 output type */
  136. struct scalerFixedRectangle {
  137.     Fixed                            left;
  138.     Fixed                            top;
  139.     Fixed                            right;
  140.     Fixed                            bottom;
  141. };
  142. typedef struct scalerFixedRectangle scalerFixedRectangle;
  143.  
  144. struct scalerVariationInfo {
  145.     scalerFixedRectangle            bounds;
  146. };
  147. typedef struct scalerVariationInfo scalerVariationInfo;
  148.  
  149. /* ScalerNewTransform input types */
  150.  
  151. enum scalerTransformFlags {
  152.     applyHintsTransform            = 1,                            /* Execute hinting instructions (grid fit) */
  153.     exactBitmapTransform        = 2,                            /* Use embedded gxBitmap iff exact size */
  154.     useThresholdTransform        = 4,                            /* Use scaled gxBitmap (if any) if below outline threshold */
  155.     verticalTransform            = 8,                            /* Glyphs will be in vertical orientation */
  156.     deviceMetricsTransform        = 16,                            /* All metrics should be device (vs. fractional) */
  157.     allScalerTransformFlags        = applyHintsTransform | exactBitmapTransform | useThresholdTransform | verticalTransform | deviceMetricsTransform
  158. };
  159.  
  160. typedef long scalerTransformFlag;
  161.  
  162. struct scalerTransform {
  163.     scalerTransformFlag                flags;                        /* Hint, embedded gxBitmap control, etc. */
  164.     Fixed                            pointSize;                    /* The desired pointsize */
  165.     const gxMapping                    *fontMatrix;                /* The 3x3 matrix to apply to glyphs */
  166.     gxPoint                            resolution;                    /* 2D device resolution */
  167.     gxPoint                            spotSize;                    /* 2D pixel size */
  168. };
  169. typedef struct scalerTransform scalerTransform;
  170.  
  171. /* ScalerNewTransform output type */
  172. struct scalerTransformInfo {
  173.     gxPoint                            before;                        /* Spacing of the line before */
  174.     gxPoint                            after;                        /* Spacing of the line after */
  175.     gxPoint                            caretAngle;                    /* Rise (y) and run (x) of the insertion caret */
  176.     gxPoint                            caretOffset;                /* Adjustment to caret for variants like italic */
  177. };
  178. typedef struct scalerTransformInfo scalerTransformInfo;
  179.  
  180. /* ScalerNewGlyph input types */
  181.  
  182. enum scalerGlyphFlags {
  183.     noImageGlyph                = 1                                /* Don't return the bitmap image for this glyph */
  184. };
  185.  
  186. typedef long scalerGlyphFlag;
  187.  
  188. /* QuickDraw GX outline */
  189.  
  190. enum {
  191.     pathOutlineFormat            = 'path'
  192. };
  193.  
  194. typedef long scalerOutlineFormat;
  195.  
  196. struct scalerGlyph {
  197.     long                            glyphIndex;                    /* Index of the glyph to be considered */
  198.     long                            bandingTop;                    /* Banding controls (scanline numbers) top=bottom=0 means no banding */
  199.     long                            bandingBottom;
  200.     scalerOutlineFormat                format;                        /* Format of outline to return, ignored if no outline desired */
  201.     scalerGlyphFlag                    flags;                        /* Control generation of image representation */
  202. };
  203. typedef struct scalerGlyph scalerGlyph;
  204.  
  205. /* ScalerNewGlyph output types */
  206. struct scalerMetrics {
  207.     gxPoint                            advance;
  208.     gxPoint                            sideBearing;
  209.     gxPoint                            otherSideBearing;
  210. };
  211. typedef struct scalerMetrics scalerMetrics;
  212.  
  213. struct scalerRectangle {
  214.     long                            xMin;
  215.     long                            yMin;
  216.     long                            xMax;
  217.     long                            yMax;
  218. };
  219. typedef struct scalerRectangle scalerRectangle;
  220.  
  221. /* ScalerKernGlyphs input/output types */
  222.  
  223. enum scalerKerningFlags {
  224.     lineStartKerning            = 1,                            /* Array of glyphs starts a line */
  225.     lineEndKerning                = 2,                            /* Array of glyphs ends a line */
  226.     noCrossKerning                = 4,                            /* Prohibit cross kerning */
  227.     allScalerKerningFlags        = lineStartKerning | lineEndKerning | noCrossKerning
  228. };
  229.  
  230. typedef long scalerKerningFlag;
  231.  
  232.  
  233. enum scalerKerningNotes {
  234.     noStakeKerningNote            = 1,                            /* Indicates a glyph was involver in a kerning pair/group */
  235.     crossStreamResetKerningNote    = 2                                /* Indicates a return-to-baseline in cross-stream kerning */
  236. };
  237.  
  238. typedef unsigned short scalerKerningNote;
  239.  
  240.  
  241. enum scalerKerningOutputs {
  242.     noKerningAppliedOutput        = 0x0001                        /* All kerning values were zero, kerning call had no effect */
  243. };
  244.  
  245. /* These are bit-fields */
  246. typedef long scalerKerningOutput;
  247.  
  248. typedef struct scalerKerning scalerKerning;
  249.  
  250. struct scalerKerning {
  251.     long                            numGlyphs;                    /* Number of glyphs in the glyphs array */
  252.     Fract                            scaleFactor;                /* Amount of kerning to apply (0 == none, fract1 == all) */
  253.     scalerKerningFlag                flags;                        /* Various control flags */
  254.     const unsigned short            *glyphs;                    /* Pointer to the array of glyphs to be kerned */
  255.     scalerKerningOutput                info;                        /* Qualitative results of kerning */
  256. };
  257. /* ScalerStream input/output types */
  258.  
  259. enum scalerStreamTypeFlags {
  260.     cexec68K                    = 0x0001,
  261.     truetypeStreamType            = 0x0001,
  262.     type1StreamType                = 0x0002,
  263.     type3StreamType                = 0x0004,
  264.     type42StreamType            = 0x0008,
  265.     type42GXStreamType            = 0x0010,
  266.     portableStreamType            = 0x0020,
  267.     flattenedStreamType            = 0x0040,
  268.     evenOddModifierStreamType    = 0x8000
  269. };
  270.  
  271. /* Possible streamed font formats */
  272. typedef unsigned long scalerStreamTypeFlag;
  273.  
  274.  
  275. enum scalerStreamActions {
  276.     downloadStreamAction        = 0,                            /* Transmit the (possibly sparse) font data */
  277.     asciiDownloadStreamAction    = 1,                            /* Transmit font data to a 7-bit ASCII destination */
  278.     fontSizeQueryStreamAction    = 2,                            /* Estimate in-printer memory used if the font were downloaded */
  279.     encodingOnlyStreamAction    = 3,                            /* Transmit only the encoding for the font */
  280.     prerequisiteQueryStreamAction = 4,                            /* Return a list of prerequisite items needed for the font */
  281.     prerequisiteItemStreamAction = 5,                            /* Transmit a specified prerequisite item */
  282.     variationQueryStreamAction    = 6,                            /* Return information regarding support for variation streaming */
  283.     variationPSOperatorStreamAction = 7                            /* Transmit Postscript code necessary to effect variation of a font */
  284. };
  285.  
  286. typedef long scalerStreamAction;
  287.  
  288.  
  289. enum {
  290.     selectAllVariations            = -1                            /* Special variationCount value meaning include all variation data */
  291. };
  292.  
  293. struct scalerPrerequisiteItem {
  294.     long                            enumeration;                /* Shorthand tag identifying the item */
  295.     long                            size;                        /* Worst case vm in printer item requires */
  296.     unsigned char                    name[1];                    /* Name to be used by the client when emitting the item (Pascal string) */
  297. };
  298. typedef struct scalerPrerequisiteItem scalerPrerequisiteItem;
  299.  
  300. struct scalerStream {
  301.     const void                        *streamRefCon;                /* <-    private reference for client */
  302.     const char                        *targetVersion;                /* <-    e.g. Postscript printer name (C string) */
  303.     scalerStreamTypeFlag            types;                        /* <->    Data stream formats desired/supplied */
  304.     scalerStreamAction                action;                        /* <-     What action to take */
  305.     unsigned long                    memorySize;                    /* ->    Worst case memory use (vm) in printer or as sfnt */
  306.     long                            variationCount;                /* <-    The number of variations, or selectAllVariations */
  307.     const struct gxFontVariation    *variations;                /* <-    A pointer to an array of the variations */
  308.     union {
  309.         struct {
  310.             const unsigned short            *encoding;            /* <-    Intention is * unsigned short[256] */
  311.             long                            *glyphBits;            /* <->    Bitvector: a bit for each glyph, 1 = desired/supplied */
  312.             char                            *name;                /* <->    The printer font name to use/used (C string) */
  313.         }                                font;                    /* Normal font streaming information */
  314.         struct {
  315.             long                            size;                /* ->     Size of the prereq. list in bytes (0 indicates no prerequisites)*/
  316.             void                            *list;                /* <-    Pointer to client block to hold list (nil = list size query only) */
  317.         }                                prerequisiteQuery;        /* Used to obtain a list of prerequisites from the scaler */
  318.         long                            prerequisiteItem;        /* <-     Enumeration value for the prerequisite item to be streamed.*/
  319.         long                            variationQueryResult;    /* ->    Output from the variationQueryStreamAction */
  320.     }                                info;
  321. };
  322. typedef struct scalerStream scalerStream;
  323.  
  324. struct scalerStreamData {
  325.     long                            hexFlag;                    /* Indicates that the data is to be interpreted as hex, versus binary */
  326.     long                            byteCount;                    /* Number of bytes in the data being streamed */
  327.     const void                        *data;                        /* Pointer to the data being streamed */
  328. };
  329. typedef struct scalerStreamData scalerStreamData;
  330.  
  331.  
  332. enum scalerBlockTypes {
  333.     scalerScratchBlock            = -1,                            /* Scaler alloced/freed temporary memory */
  334.     scalerOpenBlock                = 0,                            /* Five permanent input/state block types */
  335.     scalerFontBlock                = 1,
  336.     scalerVariationBlock        = 2,
  337.     scalerTransformBlock        = 3,
  338.     scalerGlyphBlock            = 4,
  339.     scalerBlockCount            = 5,                            /* Number of permanent block types */
  340.     scalerOutlineBlock            = scalerBlockCount,                /* Two output block types */
  341.     scalerBitmapBlock            = scalerBlockCount + 1
  342. };
  343.  
  344. typedef long scalerBlockType;
  345.  
  346. /* special tag used only by scalers to access an sfnt's directory */
  347.  
  348. enum {
  349.     sfntDirectoryTag            = 'dir '
  350. };
  351.  
  352. typedef struct scalerBitmap scalerBitmap;
  353.  
  354. typedef struct scalerContext scalerContext;
  355.  
  356. /* Type definitions for function pointers used with the scalerContext structure */
  357.  
  358. #ifdef TrueTypeCoreBuild
  359.  
  360. typedef long (*GetFontTableProcPtr)(scalerContext *context, gxFontTableTag tableTag, long offset, long length, void *data);
  361. typedef void (*ReleaseFontTableProcPtr)(scalerContext *context, void* fontData);
  362. typedef void* (*NewBlockProcPtr)(scalerContext *context, long size, scalerBlockType theType, void* oldBlock);
  363. typedef void (*DisposeBlockProcPtr)(scalerContext *context, void* scratchData, scalerBlockType theType);
  364. typedef long (*StreamFunctionProcPtr)(scalerContext *context, struct scalerStream* streamInfo, const struct scalerStreamData *dataInfo);
  365. typedef void (*ScanLineFunctionProcPtr)(scalerContext *context, const struct scalerBitmap* scanLine);
  366. typedef void (*PostErrorFunctionProcPtr)(scalerContext *context, scalerError theProblem);
  367. typedef void (*ScalerFunctionProcPtr)(scalerContext *context, void* data);
  368. #define    CallNewBlockProc(F,C,S,T,O)            (F)(C,S,T,O)
  369. #define    CallDisposeBlockProc(F,C,D,T)        (F)(C,D,T)
  370. #define CallGetFontTableProc(F,C,T,O,L,D)    (F)(C,T,O,L,D)
  371. #define CallReleaseFontTableProc(F,C,D)        (F)(C,D)
  372. #define CallPostErrorFunctionProc(F,C,E)    (F)(C,E)
  373. #define CallStreamFunctionProc(F,C,S,D)        (F)(C,S,D)
  374. #define CallScanLineFunctionProc(F,C,S)        (F)(C,S)
  375. #define CallScalerFunctionProc(F,C,D)        (F)(C,D)
  376. typedef GetFontTableProcPtr GetFontTableUPP;
  377. typedef ReleaseFontTableProcPtr ReleaseFontTableUPP;
  378. typedef NewBlockProcPtr NewBlockUPP;
  379. typedef DisposeBlockProcPtr DisposeBlockUPP;
  380. typedef StreamFunctionProcPtr StreamFunctionUPP;
  381. typedef ScanLineFunctionProcPtr ScanLineFunctionUPP;
  382. typedef PostErrorFunctionProcPtr PostErrorFunctionUPP;
  383. typedef ScalerFunctionProcPtr ScalerFunctionUPP;
  384.  
  385. #else
  386.  
  387. typedef long (*GetFontTableProcPtr)(scalerContext *context, gxFontTableTag tableTag, long offset, long length, void *data);
  388. typedef void (*ReleaseFontTableProcPtr)(scalerContext *context, void *fontData);
  389. typedef void *(*NewBlockProcPtr)(scalerContext *context, long size, scalerBlockType theType, void *oldBlock);
  390. typedef void (*DisposeBlockProcPtr)(scalerContext *context, void *scratchData, scalerBlockType theType);
  391. typedef long (*StreamFunctionProcPtr)(scalerContext *context, struct scalerStream *streamInfo, const struct scalerStreamData *dataInfo);
  392. typedef void (*ScanLineFunctionProcPtr)(scalerContext *context, const struct scalerBitmap *scanLine);
  393. typedef void (*PostErrorFunctionProcPtr)(scalerContext *context, scalerError theProblem);
  394. typedef void (*ScalerFunctionProcPtr)(scalerContext *context, void *data);
  395.  
  396. #if GENERATINGCFM
  397. typedef UniversalProcPtr GetFontTableUPP;
  398. typedef UniversalProcPtr ReleaseFontTableUPP;
  399. typedef UniversalProcPtr NewBlockUPP;
  400. typedef UniversalProcPtr DisposeBlockUPP;
  401. typedef UniversalProcPtr StreamFunctionUPP;
  402. typedef UniversalProcPtr ScanLineFunctionUPP;
  403. typedef UniversalProcPtr PostErrorFunctionUPP;
  404. typedef UniversalProcPtr ScalerFunctionUPP;
  405. #else
  406. typedef GetFontTableProcPtr GetFontTableUPP;
  407. typedef ReleaseFontTableProcPtr ReleaseFontTableUPP;
  408. typedef NewBlockProcPtr NewBlockUPP;
  409. typedef DisposeBlockProcPtr DisposeBlockUPP;
  410. typedef StreamFunctionProcPtr StreamFunctionUPP;
  411. typedef ScanLineFunctionProcPtr ScanLineFunctionUPP;
  412. typedef PostErrorFunctionProcPtr PostErrorFunctionUPP;
  413. typedef ScalerFunctionProcPtr ScalerFunctionUPP;
  414. #endif
  415.  
  416.  
  417. #endif
  418.  
  419. struct scalerBitmap {
  420.     char                            *image;                        /* Pointer to pixels */
  421.     gxPoint                            topLeft;                    /* Bitmap positioning relative to client's origin */
  422.     struct scalerRectangle            bounds;                        /* Bounding box of bitmap */
  423.     long                            rowBytes;                    /* Width in bytes */
  424. };
  425. /* scalerContext: the vehicle with which the caller and scaler communicate */
  426. struct scalerContext {
  427.     Fixed                            version;                    /* Version of the scaler API implemented by the caller */
  428.     void                            *theFont;                    /* Caller's private reference to the font being processed */
  429.     gxFontFormatTag                    format;                        /* Format of the sfnt font data, corresponds to the scaler */
  430.     GetFontTableUPP                    GetFontTable;                /* Callback for accessing sfnt tables or portions thereof */
  431.     ReleaseFontTableUPP                ReleaseFontTable;            /* Callback for releasing sfnt tables */
  432.     NewBlockUPP                        NewBlock;                    /* Callback for allocating and/or growing permanent and scratch blocks */
  433.     DisposeBlockUPP                    DisposeBlock;                /* Callback for freeing permanent and scratch blocks */
  434.     StreamFunctionUPP                StreamFunction;                /* Callback for transmitting blocks of data during streaming */
  435.     ScanLineFunctionUPP                ScanLineFunction;            /* Callback for emitting individual bitmap scanlines during scan conversion */
  436.     PostErrorFunctionUPP            PostErrorFunction;            /* Callback for posting errors and warnings */
  437.     void                            *scalerBlocks[scalerBlockCount]; /* Array of permanent scaler blocks */
  438.     ScalerFunctionUPP                ScalerFunction;                /* Callback for scaler-specific tracing, debugging, etc. */
  439. };
  440.  
  441. #ifndef TrueTypeCoreBuild
  442.  
  443.  
  444. #if GENERATINGCFM
  445. #else
  446. #endif
  447.  
  448. enum {
  449.     uppGetFontTableProcInfo = kCStackBased
  450.          | RESULT_SIZE(SIZE_CODE(sizeof(long)))
  451.          | STACK_ROUTINE_PARAMETER(1, SIZE_CODE(sizeof(scalerContext*)))
  452.          | STACK_ROUTINE_PARAMETER(2, SIZE_CODE(sizeof(gxFontTableTag)))
  453.          | STACK_ROUTINE_PARAMETER(3, SIZE_CODE(sizeof(long)))
  454.          | STACK_ROUTINE_PARAMETER(4, SIZE_CODE(sizeof(long)))
  455.          | STACK_ROUTINE_PARAMETER(5, SIZE_CODE(sizeof(void*))),
  456.     uppReleaseFontTableProcInfo = kCStackBased
  457.          | STACK_ROUTINE_PARAMETER(1, SIZE_CODE(sizeof(scalerContext*)))
  458.          | STACK_ROUTINE_PARAMETER(2, SIZE_CODE(sizeof(void*))),
  459.     uppNewBlockProcInfo = kCStackBased
  460.          | RESULT_SIZE(SIZE_CODE(sizeof(void*)))
  461.          | STACK_ROUTINE_PARAMETER(1, SIZE_CODE(sizeof(scalerContext*)))
  462.          | STACK_ROUTINE_PARAMETER(2, SIZE_CODE(sizeof(long)))
  463.          | STACK_ROUTINE_PARAMETER(3, SIZE_CODE(sizeof(scalerBlockType)))
  464.          | STACK_ROUTINE_PARAMETER(4, SIZE_CODE(sizeof(void*))),
  465.     uppDisposeBlockProcInfo = kCStackBased
  466.          | STACK_ROUTINE_PARAMETER(1, SIZE_CODE(sizeof(scalerContext*)))
  467.          | STACK_ROUTINE_PARAMETER(2, SIZE_CODE(sizeof(void*)))
  468.          | STACK_ROUTINE_PARAMETER(3, SIZE_CODE(sizeof(scalerBlockType))),
  469.     uppStreamFunctionProcInfo = kCStackBased
  470.          | RESULT_SIZE(SIZE_CODE(sizeof(long)))
  471.          | STACK_ROUTINE_PARAMETER(1, SIZE_CODE(sizeof(scalerContext*)))
  472.          | STACK_ROUTINE_PARAMETER(2, SIZE_CODE(sizeof(struct scalerStream*)))
  473.          | STACK_ROUTINE_PARAMETER(3, SIZE_CODE(sizeof(struct scalerStreamData*))),
  474.     uppScanLineFunctionProcInfo = kCStackBased
  475.          | STACK_ROUTINE_PARAMETER(1, SIZE_CODE(sizeof(scalerContext*)))
  476.          | STACK_ROUTINE_PARAMETER(2, SIZE_CODE(sizeof(struct scalerBitmap*))),
  477.     uppPostErrorFunctionProcInfo = kCStackBased
  478.          | STACK_ROUTINE_PARAMETER(1, SIZE_CODE(sizeof(scalerContext*)))
  479.          | STACK_ROUTINE_PARAMETER(2, SIZE_CODE(sizeof(scalerError))),
  480.     uppScalerFunctionProcInfo = kCStackBased
  481.          | STACK_ROUTINE_PARAMETER(1, SIZE_CODE(sizeof(scalerContext*)))
  482.          | STACK_ROUTINE_PARAMETER(2, SIZE_CODE(sizeof(void*)))
  483. };
  484.  
  485. #if GENERATINGCFM
  486. #define NewGetFontTableProc(userRoutine)        \
  487.         (GetFontTableUPP) NewRoutineDescriptor((ProcPtr)(userRoutine), uppGetFontTableProcInfo, GetCurrentArchitecture())
  488. #define NewReleaseFontTableProc(userRoutine)        \
  489.         (ReleaseFontTableUPP) NewRoutineDescriptor((ProcPtr)(userRoutine), uppReleaseFontTableProcInfo, GetCurrentArchitecture())
  490. #define NewNewBlockProc(userRoutine)        \
  491.         (NewBlockUPP) NewRoutineDescriptor((ProcPtr)(userRoutine), uppNewBlockProcInfo, GetCurrentArchitecture())
  492. #define NewDisposeBlockProc(userRoutine)        \
  493.         (DisposeBlockUPP) NewRoutineDescriptor((ProcPtr)(userRoutine), uppDisposeBlockProcInfo, GetCurrentArchitecture())
  494. #define NewStreamFunctionProc(userRoutine)        \
  495.         (StreamFunctionUPP) NewRoutineDescriptor((ProcPtr)(userRoutine), uppStreamFunctionProcInfo, GetCurrentArchitecture())
  496. #define NewScanLineFunctionProc(userRoutine)        \
  497.         (ScanLineFunctionUPP) NewRoutineDescriptor((ProcPtr)(userRoutine), uppScanLineFunctionProcInfo, GetCurrentArchitecture())
  498. #define NewPostErrorFunctionProc(userRoutine)        \
  499.         (PostErrorFunctionUPP) NewRoutineDescriptor((ProcPtr)(userRoutine), uppPostErrorFunctionProcInfo, GetCurrentArchitecture())
  500. #define NewScalerFunctionProc(userRoutine)        \
  501.         (ScalerFunctionUPP) NewRoutineDescriptor((ProcPtr)(userRoutine), uppScalerFunctionProcInfo, GetCurrentArchitecture())
  502. #else
  503. #define NewGetFontTableProc(userRoutine)        \
  504.         ((GetFontTableUPP) (userRoutine))
  505. #define NewReleaseFontTableProc(userRoutine)        \
  506.         ((ReleaseFontTableUPP) (userRoutine))
  507. #define NewNewBlockProc(userRoutine)        \
  508.         ((NewBlockUPP) (userRoutine))
  509. #define NewDisposeBlockProc(userRoutine)        \
  510.         ((DisposeBlockUPP) (userRoutine))
  511. #define NewStreamFunctionProc(userRoutine)        \
  512.         ((StreamFunctionUPP) (userRoutine))
  513. #define NewScanLineFunctionProc(userRoutine)        \
  514.         ((ScanLineFunctionUPP) (userRoutine))
  515. #define NewPostErrorFunctionProc(userRoutine)        \
  516.         ((PostErrorFunctionUPP) (userRoutine))
  517. #define NewScalerFunctionProc(userRoutine)        \
  518.         ((ScalerFunctionUPP) (userRoutine))
  519. #endif
  520.  
  521. #if GENERATINGCFM
  522. #define CallGetFontTableProc(userRoutine, context, tableTag, offset, length, data)        \
  523.         CallUniversalProc((UniversalProcPtr)(userRoutine), uppGetFontTableProcInfo, (context), (tableTag), (offset), (length), (data))
  524. #define CallReleaseFontTableProc(userRoutine, context, fontData)        \
  525.         CallUniversalProc((UniversalProcPtr)(userRoutine), uppReleaseFontTableProcInfo, (context), (fontData))
  526. #define CallNewBlockProc(userRoutine, context, size, theType, oldBlock)        \
  527.         CallUniversalProc((UniversalProcPtr)(userRoutine), uppNewBlockProcInfo, (context), (size), (theType), (oldBlock))
  528. #define CallDisposeBlockProc(userRoutine, context, scratchData, theType)        \
  529.         CallUniversalProc((UniversalProcPtr)(userRoutine), uppDisposeBlockProcInfo, (context), (scratchData), (theType))
  530. #define CallStreamFunctionProc(userRoutine, context, streamInfo, dataInfo)        \
  531.         CallUniversalProc((UniversalProcPtr)(userRoutine), uppStreamFunctionProcInfo, (context), (streamInfo), (dataInfo))
  532. #define CallScanLineFunctionProc(userRoutine, context, scanLine)        \
  533.         CallUniversalProc((UniversalProcPtr)(userRoutine), uppScanLineFunctionProcInfo, (context), (scanLine))
  534. #define CallPostErrorFunctionProc(userRoutine, context, theProblem)        \
  535.         CallUniversalProc((UniversalProcPtr)(userRoutine), uppPostErrorFunctionProcInfo, (context), (theProblem))
  536. #define CallScalerFunctionProc(userRoutine, context, data)        \
  537.         CallUniversalProc((UniversalProcPtr)(userRoutine), uppScalerFunctionProcInfo, (context), (data))
  538. #else
  539. #define CallGetFontTableProc(userRoutine, context, tableTag, offset, length, data)        \
  540.         (*(userRoutine))((context), (tableTag), (offset), (length), (data))
  541. #define CallReleaseFontTableProc(userRoutine, context, fontData)        \
  542.         (*(userRoutine))((context), (fontData))
  543. #define CallNewBlockProc(userRoutine, context, size, theType, oldBlock)        \
  544.         (*(userRoutine))((context), (size), (theType), (oldBlock))
  545. #define CallDisposeBlockProc(userRoutine, context, scratchData, theType)        \
  546.         (*(userRoutine))((context), (scratchData), (theType))
  547. #define CallStreamFunctionProc(userRoutine, context, streamInfo, dataInfo)        \
  548.         (*(userRoutine))((context), (streamInfo), (dataInfo))
  549. #define CallScanLineFunctionProc(userRoutine, context, scanLine)        \
  550.         (*(userRoutine))((context), (scanLine))
  551. #define CallPostErrorFunctionProc(userRoutine, context, theProblem)        \
  552.         (*(userRoutine))((context), (theProblem))
  553. #define CallScalerFunctionProc(userRoutine, context, data)        \
  554.         (*(userRoutine))((context), (data))
  555. #endif
  556.  
  557.  
  558. #endif  /* not TrueTypeCoreBuild */
  559.  
  560.  
  561. #if PRAGMA_IMPORT_SUPPORTED
  562. #pragma import off
  563. #endif
  564.  
  565. #if PRAGMA_ALIGN_SUPPORTED
  566. #pragma options align=reset
  567. #endif
  568.  
  569. #ifdef __cplusplus
  570. }
  571. #endif
  572.  
  573. #endif /* __SCALERTYPES__ */
  574.